reactive: true,
can_focus: true,
label: _("Cancel") });
- this.cancelButton.connect('clicked', () => { this.cancel(); });
+ this.cancelButton.connect('clicked', () => this.cancel());
this._buttonBox.add(this.cancelButton,
{ expand: false,
x_fill: false,
reactive: true,
can_focus: true,
label: _("Next") });
- this.nextButton.connect('clicked', () => { this.emit('next'); });
+ this.nextButton.connect('clicked', () => this.emit('next'));
this.nextButton.add_style_pseudo_class('default');
this._buttonBox.add(this.nextButton,
{ expand: false,
item.connect('activate', this._onItemActivated.bind(this));
// Try to keep the focused item front-and-center
- item.actor.connect('key-focus-in', () => { this.scrollToItem(item); });
+ item.actor.connect('key-focus-in', () => this.scrollToItem(item));
this._moveFocusToItems();
{ actionMode: Shell.ActionMode.NONE });
this._manager.addMenu(this._menu);
- this._button.connect('clicked', () => { this._menu.toggle(); });
+ this._button.connect('clicked', () => this._menu.toggle());
this._items = {};
this._activeSessionId = null;
}
_onSessionOpened(client, serviceName) {
- this._authPrompt.finish(() => { this._startSession(serviceName); });
+ this._authPrompt.finish(() => this._startSession(serviceName));
}
_waitForItemForUser(userName) {
hold.release();
});
- hold.connect('release', () => { this._userList.disconnect(signalId); });
+ hold.connect('release', () => this._userList.disconnect(signalId));
return hold;
}
Service(Gio.DBus.system,
'org.freedesktop.realmd',
'/org/freedesktop/realmd',
- service => { service.ReleaseRemote(); });
+ service => service.ReleaseRemote());
this._aggregateProvider.disconnect(this._signalId);
this._realms = { };
this._updateLoginFormat();
if (!GLib.str_has_suffix(path, '/InputContext_1'))
this.emit ('focus-in');
});
- this._panelService.connect('focus-out', () => { this.emit('focus-out'); });
+ this._panelService.connect('focus-out', () => this.emit('focus-out'));
try {
// IBus versions older than 1.5.10 have a bug which
this._userManager = AccountsService.UserManager.get_default();
this._userManager.connect('notify::is-loaded',
- () => { this._updateMultiUser(); });
+ () => this._updateMultiUser());
this._userManager.connect('notify::has-multiple-users',
- () => { this._updateMultiUser(); });
+ () => this._updateMultiUser());
this._userManager.connect('user-added',
- () => { this._updateMultiUser(); });
+ () => this._updateMultiUser());
this._userManager.connect('user-removed',
- () => { this._updateMultiUser(); });
+ () => this._updateMultiUser());
this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
- () => { this._updateSwitchUser(); });
+ () => this._updateSwitchUser());
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
- () => { this._updateLogout(); });
+ () => this._updateLogout());
global.settings.connect('changed::' + ALWAYS_SHOW_LOG_OUT_KEY,
- () => { this._updateLogout(); });
+ () => this._updateLogout());
this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
- () => { this._updateLockScreen(); });
+ () => this._updateLockScreen());
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
- () => { this._updateHaveShutdown(); });
+ () => this._updateHaveShutdown());
this.forceUpdate();
this._updateOrientationLockIcon();
});
Main.layoutManager.connect('monitors-changed',
- () => { this._updateOrientationLock(); });
+ () => this._updateOrientationLock());
Gio.DBus.system.watch_name(SENSOR_BUS_NAME,
Gio.BusNameWatcherFlags.NONE,
- () => { this._sensorProxyAppeared(); },
+ () => this._sensorProxyAppeared(),
() => {
this._sensorProxy = null;
this._updateOrientationLock();
this._updateOrientationLock();
this._updateOrientationLockIcon();
- Main.sessionMode.connect('updated', () => { this._sessionUpdated(); });
+ Main.sessionMode.connect('updated', () => this._sessionUpdated());
this._sessionUpdated();
}
return;
}
this._sensorProxy.connect('g-properties-changed',
- () => { this._updateOrientationLock(); });
+ () => this._updateOrientationLock());
this._updateOrientationLock();
});
}
getMatchingActions(terms) {
// terms is a list of strings
- terms = terms.map((term) => { return term.toLowerCase(); });
+ terms = terms.map((term) => term.toLowerCase());
let results = [];
let id = _desktopSettings.connect('changed::clock-format', () => {
label.text = formatTime(date, params);
});
- label.connect('destroy', () => { _desktopSettings.disconnect(id); });
+ label.connect('destroy', () => _desktopSettings.disconnect(id));
return label;
}
}
_setSettings(settings) {
- this._handlers.forEach((handler) => { this._disconnectHandler(handler); });
+ this._handlers.forEach((handler) => this._disconnectHandler(handler));
let hadSettings = (this._settings != null);
this._settings = settings;
let haveSettings = (this._settings != null);
- this._handlers.forEach((handler) => { this._connectHandler(handler); });
+ this._handlers.forEach((handler) => this._connectHandler(handler));
if (hadSettings != haveSettings)
this.emit('available-changed');
this._weatherAppMon = new Util.AppSettingsMonitor('org.gnome.Weather.desktop',
'org.gnome.Weather');
- this._weatherAppMon.connect('available-changed', () => { this.emit('changed'); });
+ this._weatherAppMon.connect('available-changed', () => this.emit('changed'));
this._weatherAppMon.watchSetting('automatic-location',
this._onAutomaticLocationChanged.bind(this));
this._weatherAppMon.watchSetting('locations',
cb();
});
- return callback => { cb = callback; };
+ return callback => cb = callback;
}
function waitSignal(object, signal) {
cb();
});
- return callback => { cb = callback; };
+ return callback => cb = callback;
}
function extractBootTimestamp() {
this._queue = [];
let action = new Gio.SimpleAction({ name: 'quit' });
- action.connect('activate', () => { this.active_window.destroyWindow(); });
+ action.connect('activate', () => this.active_window.destroyWindow());
this.add_action(action);
}
subtitle, body, options);
dialog.open();
- dialog.connect('closed', () => { this._accessDialog = null; });
+ dialog.connect('closed', () => this._accessDialog = null);
this._accessDialog = dialog;
}
{ opacity: 255,
time: THUMBNAIL_FADE_TIME,
transition: 'easeOutQuad',
- onComplete: () => { this.thumbnailsVisible = true; }
+ onComplete: () => this.thumbnailsVisible = true
});
this._switcherList._items[this._selectedIndex].add_accessible_state (Atk.StateType.EXPANDED);
});
let arrow = new St.DrawingArea({ style_class: 'switcher-arrow' });
- arrow.connect('repaint', () => { SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM); });
+ arrow.connect('repaint', () => SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM));
this.add_actor(arrow);
this._arrows.push(arrow);
loadGrid() {
this._allItems.sort(this._compareItems);
- this._allItems.forEach(item => { this._grid.addItem(item); });
+ this._allItems.forEach(item => this._grid.addItem(item));
this.emit('view-loaded');
}
} else {
params.opacity = 0;
params.delay = 0;
- params.onComplete = () => { this.actor.hide(); };
+ params.onComplete = () => this.actor.hide();
}
Tweener.addTween(this._grid, params);
this._availWidth = 0;
this._availHeight = 0;
- Main.overview.connect('hidden', () => { this.goToPage(0); });
+ Main.overview.connect('hidden', () => this.goToPage(0));
this._grid.connect('space-opened', () => {
let fadeEffect = this._scrollView.get_effect('fade');
if (fadeEffect)
global.focus_manager.add_group(this.actor);
- source.actor.connect('destroy', () => { this.actor.destroy(); });
+ source.actor.connect('destroy', () => this.actor.destroy());
this._grabHelper = new GrabHelper.GrabHelper(this.actor, {
actionMode: Shell.ActionMode.POPUP
});
let [deviceNames] = params;
let devices = 0;
- deviceNames.forEach(n => { devices |= AudioDevice[n.toUpperCase()]; });
+ deviceNames.forEach(n => devices |= AudioDevice[n.toUpperCase()]);
let dialog;
try {
this._clearButton.set_x_align(Clutter.ActorAlign.END);
this._clearButton.connect('clicked', () => {
let sections = [...this._sections.keys()];
- sections.forEach((s) => { s.clear(); });
+ sections.forEach((s) => s.clear());
});
box.add_actor(this._clearButton);
this._pluginDir = Gio.file_new_for_path(Config.VPNDIR);
try {
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
- monitor.connect('changed', () => { this._vpnCacheBuilt = false; });
+ monitor.connect('changed', () => this._vpnCacheBuilt = false);
} catch (e) {
log('Failed to create monitor for VPN plugin dir: ' + e.message);
}
item.iconName = icon;
this._items.push(item);
- root.connect('destroy', () => { this.removeGroup(root); });
+ root.connect('destroy', () => this.removeGroup(root));
if (root instanceof St.Widget)
global.focus_manager.add_group(root);
}
Main.messageTray.connect('queue-changed', this._updateCount.bind(this));
let sources = Main.messageTray.getSources();
- sources.forEach(source => { this._onSourceAdded(null, source); });
+ sources.forEach(source => this._onSourceAdded(null, source));
}
_onSourceAdded(tray, source) {
_updateCount() {
let count = 0;
- this._sources.forEach(source => { count += source.unseenCount; });
+ this._sources.forEach(source => count += source.unseenCount);
count -= Main.messageTray.queueCount;
this.actor.visible = (count > 0);
class IndicatorPad extends St.Widget {
_init(actor) {
this._source = actor;
- this._source.connect('notify::visible', () => { this.queue_relayout(); });
- this._source.connect('notify::size', () => { this.queue_relayout(); });
+ this._source.connect('notify::visible', () => this.queue_relayout());
+ this._source.connect('notify::size', () => this.queue_relayout());
super._init();
}
this._allowedModes = allowedModes;
this.set_n_touch_points(1);
- global.display.connect('grab-op-begin', () => { this.cancel(); });
+ global.display.connect('grab-op-begin', () => this.cancel());
}
_getMonitorRect(x, y) {
}
_cancelAnimation() {
- this._clonesAnimating.forEach(clone => { clone.destroy(); });
+ this._clonesAnimating.forEach(clone => clone.destroy());
this._clonesAnimating = [];
}
transition: 'easeInOutQuad'
};
if (i == (children.length - 1))
- params.onComplete = () => { this.emit('space-opened'); };
+ params.onComplete = () => this.emit('space-opened');
Tweener.addTween(children[i], params);
}
}
{ translation_y: 0,
time: EXTRA_SPACE_ANIMATION_TIME,
transition: 'easeInOutQuad',
- onComplete: () => { this.emit('space-closed'); }
+ onComplete: () => this.emit('space-closed')
});
}
}
x_expand: true,
y_expand: true,
vertical: true });
- this.actor.connect('notify::mapped', () => { this._emojiPager.setCurrentPage(0); });
+ this.actor.connect('notify::mapped', () => this._emojiPager.setCurrentPage(0));
this._emojiPager = new EmojiPager(this._sections, 11, 3);
this._emojiPager.connect('page-changed', (pager, section, page, nPages) => {
key = new Key('ABC', []);
key.keyButton.add_style_class_name('default-key');
- key.connect('released', () => { this.emit('toggle'); });
+ key.connect('released', () => this.emit('toggle'));
row.appendKey(key.actor, 1.5);
for (let i = 0; i < this._sections.length; i++) {
let section = this._sections[i];
key = new Key(section.label, []);
- key.connect('released', () => { this._emojiPager.setCurrentSection(section, 0); });
+ key.connect('released', () => this._emojiPager.setCurrentSection(section, 0));
row.appendKey(key.actor);
section.button = key;
this._emojiSelection = new EmojiSelection();
this._emojiSelection.connect('toggle', this._toggleEmoji.bind(this));
- this._emojiSelection.connect('hide', (selection) => { this.hide(); });
+ this._emojiSelection.connect('hide', (selection) => this.hide());
this._emojiSelection.connect('emoji-selected', (selection, emoji) => {
this._keyboardController.commitString(emoji);
});
this.actor.add(scrollview, { expand: true });
let vAdjust = scrollview.vscroll.adjustment;
- vAdjust.connect('changed', () => { this._onAdjustScopeChanged(tabData); });
- vAdjust.connect('notify::value', () => { this._onAdjustValueChanged(tabData); });
+ vAdjust.connect('changed', () => this._onAdjustScopeChanged(tabData));
+ vAdjust.connect('notify::value', () => this._onAdjustValueChanged(tabData));
if (this._selectedIndex == -1)
this.selectIndex(0);
}
_queueResize() {
- Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { this._resize(); });
+ Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => this._resize());
}
_resize() {
this.actor.accessible_name = _("Volume");
- this.actor.connect('notify::width', () => { this.level = this.level; });
+ this.actor.connect('notify::width', () => this.level = this.level);
}
get level() {
}
setButtonActionsActive(active) {
- this._buttonItems.forEach(item => { item.setSensitive(active); });
+ this._buttonItems.forEach(item => item.setSensitive(active));
}
};
Signals.addSignalMethods(ActionComboBox.prototype);
Main.sessionMode.connect('updated', this._updatePanel.bind(this));
- global.display.connect('workareas-changed', () => { this.queue_relayout(); });
+ global.display.connect('workareas-changed', () => this.queue_relayout());
this._updatePanel();
}
this.menu = new PopupSubMenu(this, this._triangle);
this.menu.connect('open-state-changed', this._subMenuOpenStateChanged.bind(this));
- this.connect('destroy', () => { this.menu.destroy(); });
+ this.connect('destroy', () => this.menu.destroy());
}
_setParent(parent) {
this._enableInternalCommands = global.settings.get_boolean('development-tools');
this._internalCommands = {
- 'lg': () => { Main.createLookingGlass().open(); },
+ 'lg': () => Main.createLookingGlass().open(),
'r': this._restart.bind(this),
// Developer brain backwards compatibility
'restart': this._restart.bind(this),
- 'debugexit': () => { Meta.quit(Meta.ExitCode.ERROR); },
+ 'debugexit': () => Meta.quit(Meta.ExitCode.ERROR),
// rt is short for "reload theme"
'rt': () => {
this._loginManager.getCurrentSessionProxy(sessionProxy => {
this._loginSession = sessionProxy;
this._loginSession.connectSignal('Lock',
- () => { this.lock(false); });
+ () => this.lock(false));
this._loginSession.connectSignal('Unlock',
- () => { this.deactivate(false); });
+ () => this.deactivate(false));
this._loginSession.connect('g-properties-changed', this._syncInhibitor.bind(this));
this._syncInhibitor();
});
deactivate(animate) {
if (this._dialog)
- this._dialog.finish(() => { this._continueDeactivate(animate); });
+ this._dialog.finish(() => this._continueDeactivate(animate));
else
this._continueDeactivate(animate);
}
_onButtonPressEvent(actor, event, entry);
});
- entry.connect('popup-menu', actor => { _onPopup(actor, entry); });
+ entry.connect('popup-menu', actor => _onPopup(actor, entry));
entry.connect('destroy', () => {
entry.menu.destroy();
for (let idx = 0; idx < choices.length; idx++) {
let button = idx;
buttons.unshift({ label: choices[idx],
- action: () => { dialog.emit('response', button); }
+ action: () => dialog.emit('response', button)
});
}
let is = this._inputSourceManager.inputSources[i];
let menuItem = new LayoutMenuItem(is.displayName, is.shortName);
- menuItem.connect('activate', () => { is.activate(true); });
+ menuItem.connect('activate', () => is.activate(true));
let indicatorLabel = new St.Label({ text: is.shortName,
visible: false });
if (!item)
return;
- item.connect('icon-changed', () => { this._iconChanged(); });
+ item.connect('icon-changed', () => this._iconChanged());
item.connect('activation-failed', (item, reason) => {
this.emit('activation-failed', reason);
});
can_focus: true,
reactive: true });
- this.connect('key-focus-in', () => { this.emit('selected'); });
+ this.connect('key-focus-in', () => this.emit('selected'));
let action = new Clutter.ClickAction();
- action.connect('clicked', () => { this.grab_key_focus(); });
+ action.connect('clicked', () => this.grab_key_focus());
this.add_action(action);
let title = ssidToLabel(this._ap.get_ssid());
'network-transmit-receive');
this._source.policy = new MessageTray.NotificationApplicationPolicy('gnome-network-panel');
- this._source.connect('destroy', () => { this._source = null; });
+ this._source.connect('destroy', () => this._source = null);
Main.messageTray.add(this._source);
}
}
this._standard.connect('notify::visible', this._sync.bind(this));
if (this._standard instanceof St.Button)
this._standard.connect('clicked',
- () => { this._clickAction.release(); });
+ () => this._clickAction.release());
this._alternate = alternate;
this._alternate.connect('notify::visible', this._sync.bind(this));
if (this._alternate instanceof St.Button)
this._alternate.connect('clicked',
- () => { this._clickAction.release(); });
+ () => this._clickAction.release());
this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
this.actor = new St.Bin();
this.actor.connect('destroy', this._onDestroy.bind(this));
- this.actor.connect('notify::mapped', () => { this._flipped = false; });
+ this.actor.connect('notify::mapped', () => this._flipped = false);
}
_sync() {
this._createSubMenu();
this._loginScreenItem.connect('notify::visible',
- () => { this._updateMultiUser(); });
+ () => this._updateMultiUser());
this._logoutItem.connect('notify::visible',
- () => { this._updateMultiUser(); });
+ () => this._updateMultiUser());
// Whether shutdown is available or not depends on both lockdown
// settings (disable-log-out) and Polkit policy - the latter doesn't
// notify, so we update the menu item each time the menu opens or
this._settingsAction.connect('notify::visible',
- () => { this._updateActionsVisibility(); });
+ () => this._updateActionsVisibility());
this._orientationLockAction.connect('notify::visible',
- () => { this._updateActionsVisibility(); });
+ () => this._updateActionsVisibility());
this._lockScreenAction.connect('notify::visible',
- () => { this._updateActionsVisibility(); });
+ () => this._updateActionsVisibility());
this._altSwitcher.actor.connect('notify::visible',
- () => { this._updateActionsVisibility(); });
+ () => this._updateActionsVisibility());
}
_onSettingsClicked() {
if (!this._source) {
this._source = new MessageTray.Source(_("Thunderbolt"),
'thunderbolt-symbolic');
- this._source.connect('destroy', () => { this._source = null; });
+ this._source.connect('destroy', () => this._source = null);
Main.messageTray.add(this._source);
}
this._list.add_actor(bbox);
let n = this._items.length;
- bbox.connect('clicked', () => { this._onItemClicked(n); });
+ bbox.connect('clicked', () => this._onItemClicked(n));
bbox.connect('motion-event', () => this._onItemEnter(n));
bbox.label_actor = label;
state.destroyedId = target.connect('destroy', _actorDestroyed);
} else if (target.actor && target.actor instanceof Clutter.Actor) {
state.actor = target.actor;
- state.destroyedId = target.actor.connect('destroy', () => { _actorDestroyed(target); });
+ state.destroyedId = target.actor.connect('destroy', () => _actorDestroyed(target));
}
}
handler(target);
};
} else {
- params[name] = () => { handler(target); };
+ params[name] = () => handler(target);
}
}
this.signalIDs.push(this._window.connect('notify::urgent',
this._sync.bind(this)));
this.signalIDs.push(this._window.connect('focus',
- () => { this.destroy(); }));
+ () => this.destroy()));
this.signalIDs.push(this._window.connect('unmanaged',
- () => { this.destroy(); }));
+ () => this.destroy()));
}
_sync() {
_showPadOsd(display, device, settings, imagePath, editionMode, monitorIndex) {
this._currentPadOsd = new PadOsd.PadOsd(device, settings, imagePath, editionMode, monitorIndex);
- this._currentPadOsd.connect('closed', () => { this._currentPadOsd = null; });
+ this._currentPadOsd.connect('closed', () => this._currentPadOsd = null);
return this._currentPadOsd.actor;
}
this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('key-press-event', this._onKeyPress.bind(this));
- this.actor.connect('enter-event', () => { this.emit('show-chrome'); });
- this.actor.connect('key-focus-in', () => { this.emit('show-chrome'); });
+ this.actor.connect('enter-event', () => this.emit('show-chrome'));
+ this.actor.connect('key-focus-in', () => this.emit('show-chrome'));
- this.actor.connect('leave-event', () => { this.emit('hide-chrome'); });
- this.actor.connect('key-focus-out', () => { this.emit('hide-chrome'); });
+ this.actor.connect('leave-event', () => this.emit('hide-chrome'));
+ this.actor.connect('key-focus-out', () => this.emit('hide-chrome'));
this._draggable = DND.makeDraggable(this.actor,
{ restoreOnSuccess: true,